#include<bits/stdc++.h>
#define XH(i,a,b) for(int i=a;i<b;++i)
#define XXH(i,a,b) for(int i=a-1;i>=b;--i)
#define LL long long
using namespace std;
int tmpINT; string tmpSTRING; char tmpCHAR; double tmpDOUBLE; LL tmpLONGLONG;

int main(){
	int n,x;scanf("%d%d", &n,&x);
	x*=100;
	int v[n],p[n];
	XH(i , 0 , n)scanf("%d%d", &v[i],&p[i]);
	int a[n];
	XH(i , 0 , n)a[i] = v[i]*p[i];
	int tol = 0;
	XH(i , 0 , n){
		tol += a[i];
		if(tol>x){
			printf("%d\n", i+1);
			return 0;
		}
	}
	printf("-1\n");
	
	return 0;
}